using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Framework;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.Localization;
using System.Data;

namespace ITCrossing
{
	public partial class itcMetaPost_ManageProviders : PortalModuleBase
    {

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
			Load +=new EventHandler(Page_Load);

			// Replace the object qualifier with the right string.
			SqlDataSource1.SelectCommand =
				SqlDataSource1.SelectCommand.Replace("{databaseOwner}", MetaPostServices.DatabaseOwner);
			SqlDataSource1.SelectCommand =
				SqlDataSource1.SelectCommand.Replace("{objectQualifier}", MetaPostServices.ObjectQualifier);
			SqlDataSource1.UpdateCommand =
				SqlDataSource1.UpdateCommand.Replace("{databaseOwner}", MetaPostServices.DatabaseOwner);
			SqlDataSource1.UpdateCommand =
				SqlDataSource1.UpdateCommand.Replace("{objectQualifier}", MetaPostServices.ObjectQualifier);

        }

        protected void Page_Load(object sender, EventArgs e)
		{
			if (AJAX.IsInstalled())
            {
                AJAX.RegisterScriptManager();
            }
            if (!Page.IsPostBack)
			{
			}

			lnkReturn.NavigateUrl = Globals.NavigateURL(TabId, "Admin", "mid=" + ModuleId);

			ContainerControl.Visible = (UserInfo.IsSuperUser) ? true : false;
			
        }
    }
}